/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.aseo.model.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 *
 * @author usuario
 */
@Entity
@Table(name = "reclamo_media")
public class ReclamoMedia implements Serializable {
    private static final long serialVersionUID = 1L;
    @SequenceGenerator(name = "reclamo_media_id_reclamo_media_seq", sequenceName = "reclamo_media_id_reclamo_media_seq")
    @GeneratedValue(generator = "reclamo_media_id_reclamo_media_seq")
    @Id
    @Basic(optional = false)
    @Column(name = "id_reclamo_media")
    private Long idReclamoMedia;
    @Lob
    @Column(name = "media")
    private byte[] media;
    @JoinColumn(name = "id_reclamo", referencedColumnName = "id_reclamo")
    @ManyToOne
    private Reclamo idReclamo;
    @JoinColumn(name = "id_tipo_media", referencedColumnName = "id_tipo_media")
    @ManyToOne
    private TipoMedia idTipoMedia;

    public ReclamoMedia() {
    }

    public ReclamoMedia(Long idReclamoMedia) {
        this.idReclamoMedia = idReclamoMedia;
    }

    public Long getIdReclamoMedia() {
        return idReclamoMedia;
    }

    public void setIdReclamoMedia(Long idReclamoMedia) {
        this.idReclamoMedia = idReclamoMedia;
    }

    public byte[] getMedia() {
        return media;
    }

    public void setMedia(byte[] media) {
        this.media = media;
    }

    public Reclamo getIdReclamo() {
        return idReclamo;
    }

    public void setIdReclamo(Reclamo idReclamo) {
        this.idReclamo = idReclamo;
    }

    public TipoMedia getIdTipoMedia() {
        return idTipoMedia;
    }

    public void setIdTipoMedia(TipoMedia idTipoMedia) {
        this.idTipoMedia = idTipoMedia;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idReclamoMedia != null ? idReclamoMedia.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ReclamoMedia)) {
            return false;
        }
        ReclamoMedia other = (ReclamoMedia) object;
        if ((this.idReclamoMedia == null && other.idReclamoMedia != null) || (this.idReclamoMedia != null && !this.idReclamoMedia.equals(other.idReclamoMedia))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.aseo.model.entity.ReclamoMedia[idReclamoMedia=" + idReclamoMedia + "]";
    }

}
